package com.kotlin.android.api.bean

import android.os.Parcel
import android.os.Parcelable

/**
 * 推荐位数据
 */
data class Extra(
        var content: String? = null,
        var identifier: String? = "",
        var showTime: Int = 0,
        var title: String? = "",
        var jumpTo: String? = "",
        var url: String? = "",
        var currentTime: Long = 0L,
        var imgUrl: String? = "",
        var operate: String? = "",
        var cinemaId: String? = "",
        var filmId: String? = "",
        var startTime: Long = 0L,
        var endTime: Long = 0L,
        var status: Boolean = false,
        var isInAppWebView: Boolean = false,
        var activityId: String? = "",
        var activityName: String? = "",
        var commendId: Long = 0L,
        var followNumber: Int = 0,
        var promoID: String? = "",
        var name: String? = "",
        var orderId: String? = "",
        var cityName: String? = "",
        var cityId: String? = "",
        var coverCode: String? = "",//卡面编码
        var voucherActivityId: String? = "",//券活动ID
        var snacksId: String? = "",//卖品ID
        var isWebViewNeedLogin:Boolean = false

) : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readLong(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readLong(),
            parcel.readLong(),
            parcel.readByte() != 0.toByte(),
            parcel.readByte() != 0.toByte(),
            parcel.readString(),
            parcel.readString(),
            parcel.readLong(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readByte() != 0.toByte()) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(content)
        parcel.writeString(identifier)
        parcel.writeInt(showTime)
        parcel.writeString(title)
        parcel.writeString(jumpTo)
        parcel.writeString(url)
        parcel.writeLong(currentTime)
        parcel.writeString(imgUrl)
        parcel.writeString(operate)
        parcel.writeString(cinemaId)
        parcel.writeString(filmId)
        parcel.writeLong(startTime)
        parcel.writeLong(endTime)
        parcel.writeByte(if (status) 1 else 0)
        parcel.writeByte(if (isInAppWebView) 1 else 0)
        parcel.writeString(activityId)
        parcel.writeString(activityName)
        parcel.writeLong(commendId)
        parcel.writeInt(followNumber)
        parcel.writeString(promoID)
        parcel.writeString(name)
        parcel.writeString(orderId)
        parcel.writeString(cityName)
        parcel.writeString(cityId)
        parcel.writeString(coverCode)
        parcel.writeString(voucherActivityId)
        parcel.writeString(snacksId)
        parcel.writeByte(if (isWebViewNeedLogin) 1 else 0)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<Extra> {
        override fun createFromParcel(parcel: Parcel): Extra {
            return Extra(parcel)
        }

        override fun newArray(size: Int): Array<Extra?> {
            return arrayOfNulls(size)
        }
    }
}


